package org.mbds.android.p2p.threads;

/**
 * @author doliere
 * This thread just sleeps and awake after 5 seconds
 * to notify the main thread that it has to restart the
 * discovery.
 */
import org.mbds.android.p2p.services.P2pService;

import android.os.AsyncTask;

public class ServiceDiscovery extends AsyncTask<Void, Void, Void>{
	
	P2pService mService;
	public ServiceDiscovery(P2pService service){
		mService = service;
	}
	@Override
	protected Void doInBackground(Void... params) {
		// TODO Auto-generated method stub
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	
	@Override
	protected void onPostExecute(Void result){
		mService.startDiscoveryFailed();
	}

}
